<?php
class C_reportproject extends CI_Controller {
	function __construct(){
		parent::__construct();
		checkLogin();
		$this->load->model('m_reportproject');
	}
	
	function index(){
		$task = secure_post('task');
		switch($task){
			case "detail" :
				$data["task"] = "detail";
				$project_id = secure_post("project_id");
				$data["data"] = $this->m_reportproject->data_detail($project_id);
				$html = $this->load->view('v_reportproject', $data, true);
				$file = fopen("print/reportproject.html","w+");
				fwrite($file,$html);
				fclose($file);
				echo $html;
			break;
			default :
				$html = $this->load->view('v_reportproject', null, true);
				$file = fopen("print/reportproject.html","w+");
				fwrite($file,$html);
				fclose($file);
				echo $html;
		}
	}

}